/*! 
 * Header file for a collision box.
 *
 * \author Devis Rossini
 * \date 19 March 2012
 */
#ifndef PHXCOLLISIONBOX_H_INCLUDE_GUARD
#define PHXCOLLISIONBOX_H_INCLUDE_GUARD

#include "PhxCore.h"
#include "PhxCollisionPrimitive.h"
#include "PhxCollisionPrimitiveDescriptor.h"

namespace phx
{
	/*!
	 * Box descriptor.
	 */
	struct CollisionBoxDescriptor : public CollisionPrimitiveDescriptor
	{
		/*!
		 * Constructor.
		 */
		CollisionBoxDescriptor() 
			: mHalfSize(Vector3::ZERO) { }

		/*!
		 * Destructor (virtual).
		 */
		~CollisionBoxDescriptor() { }

		/*!
		 * Return the shape type.
		 */
		virtual ShapeTypes GetShapeType() const { return BOX_SHAPE; }

        /*!
         * Holds the half-sizes of the box along each of its local axes.
         */
		Vector3 mHalfSize;
	};

	/*!
     * Represents a rigid body that can be treated as an aligned bounding
     * box for collision detection.
     */
    class CollisionBox : public CollisionPrimitive
    {
    public:
	
		/*! 
		 * Constructor.
		 */ 
		CollisionBox() { }

		/*!
		 * Constructor (with descriptor).
		 */
		CollisionBox(const CollisionBoxDescriptor& desc) 
			: CollisionPrimitive(desc), mHalfSize(desc.mHalfSize) { }

		/*!
		 * Destructor (virtual).
		 */
		virtual ~CollisionBox() { }

		/*!
		 * Return the shape type.
		 */
		virtual inline ShapeTypes GetShapeType() const { return BOX_SHAPE; }

        /*!
         * Holds the half-sizes of the box along each of its local axes.
         */
        Vector3 mHalfSize;
    };
}

#endif // PHXCOLLISIONBOX_H_INCLUDE_GUARD